<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>住院记录详情</title>
    <%- include('../_global/baseLibsJKDA') %>
        <link rel="stylesheet" href="/static/css/jkda/page-main.css" />
        <link rel="stylesheet" href="/static/css/public.css">
        <script src="/static/js/<%=type%>/pageUrl.js"></script>
        <script src="/static/js/<%=type%>/jkda.js"></script>
        <style type="text/css">
            html,
            body {
                width: 100%;
                height: 100%;
                margin: 0px;
                background: #fff;
            }

            table {
                margin: 1rem 0;
            }

            tr th,
            td {
                text-align: center;
            }

            tr td {
                /* border-bottom: 1px solid #eee; */
                font-size: 1.1rem;
                padding: .3rem;
                line-height: 2rem;
            }

            .bg_white {
                background: #fff;
            }

            .cyxj-list li {
                margin-bottom: 10px;
            }
        </style>

</head>

<body>
    <header class="header-box grey fixed">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0);">
                    <i class="iconfont icon-back"></i>
                </a>
            </div>
            <div class="title">住院记录详情</div>
        </div>
    </header>
    <section class="page-clinic-details bg_white">
        <ul class="detail zyDetail">
            <li class="t-box">
                <i class="detail-icon j-1"></i>
                <h3>住院信息</h3>
                <div id="Mzxx">
                    <li>医院:
                        <span name="hosName"></span>
                    </li>
                    <li>入院时间:
                        <span name="startDate"></span>
                    </li>
                    <li>出院时间:
                        <span name="endDate"></span>
                    </li>
                </div>
            </li>
            </li>
        </ul>
        <ul class="detail">
            <li class="t-box">
                <i class="detail-icon j-1"></i>
                <h3>药品信息</h3>
                <div>

                </div>
            </li>
            <div id="zyMedicine">

            </div>
        </ul>
        <ul class="detail" id="cyxj">
            <li class="t-box">
                <i class="detail-icon j-1"></i>
                <h3>出院小结报告</h3>
                <div id="Cyxjbg">

                </div>
            </li>
        </ul>
    </section>
</body>
<script type="text/javascript">
    var page_zyDetail = (function ($, page_zyDetail) {

        var cfg_def = {
            initdata: initdata,
            queryZysxq: queryZysxq,
            getReport: getReport,
        }

        page_zyDetail.init = function (cfg) {
            $.extend(page_zyDetail, cfg_def, cfg);
            page_zyDetail.initdata();

        }


        function initdata() {
            // var EID = $.JkdaUtils.decryptStr("fjzlyd-jkda-yddy",$.QuickUrlUtils.getRequest("JKDAEID"));
            // var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
            var info = StoreCache.getCache("zyInfo");
            $(".zyDetail").find("span").each(function () {
                $(this).text(info[$(this).attr("name")]);
            });
            var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
            var serialNumber = info.serialNumber;
            var hosOrgCode = info.hosCode;
            //获取住院药品信息
            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/jkda/queryDetailZyYsbg",
                callback: page_zyDetail.queryZysxq,
                params: {
                    "zxwyh": zxwyh,
                    "serialNumber": serialNumber, //就诊流水号
                    "hosOrgCode": hosOrgCode, //医疗机构代码
                },
                header: true
            });
            // $.QuickRemote.AjaxJson(
            //     $.getMyorderUrl.getpageUrl("queryZysxq"),
            //      queryZysxq,
            //      {
            //         "zxwyh": zxwyh,
            //         "serialNumber":serialNumber, //就诊流水号
            //         "hosOrgCode": hosOrgCode, //医疗机构代码
            //     }

            // )



            //获取出院小结
            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/jkda/getPrescriptionZycyxj",
                callback: page_zyDetail.getReport,
                params: {
                    "zxwyh": zxwyh,
                    "serialNumber": serialNumber, //就诊流水号
                    "hosOrgCode": hosOrgCode, //医疗机构代码

                    // "zxwyh": "31011019530217166X",
                    // "serialNumber": "20141224370701", //就诊流水号
                    // "hosOrgCode": "42490643901",
                },
                header: true
            });
            // $.QuickRemote.AjaxJson(
            //     $.getMyorderUrl.getpageUrl("getReport"),
            //      getReport,
            //      {
            //         "zxwyh": zxwyh,
            //         "serialNumber":serialNumber, //就诊流水号
            //         "hosOrgCode": hosOrgCode, //医疗机构代码
            //     }
            // )
        }

        function queryZysxq(response) {
            $("#zyMedicine").html(template("Medicine", {
                data: response
            }));
        }

        function getReport(response) {
            $("#cyxj").append(template("cyxjTmp", {
                data: response
            }));
        }






        return page_zyDetail;
    })(jQuery, {});
</script>
<script type="text/html" id="Medicine">

    <table>
        <tr>
            <th>药品名称</th>
            <th>用法</th>
            <th>频次</th>
            <th>服药量</th>
            <th>用药量</th>
        </tr>
        {{each data}}
        <tr>
            <td width="30%">{{$value.ypmc}}</td>
            <td width="20%">{{$value.yf}}</td>
            <td width="20%">{{$value.yypc}}</td>
            <td width="15%">{{$value.fyl}}</td>
            <td width="15%">{{$value.yyl}}</td>
        </tr>
        {{/each}}
    </table>

</script>
<script type="text/html" id="cyxjTmp">
    {{each data}}
    <li>
        <ul class="cyxj-list">
            <li>
                <h3>门诊诊断</h3>
                <p>{{$value.mzzd}}</p>
            </li>
            <li>
                <h3>入院诊断</h3>
                <p>{{$value.ryzd}}</p>
            </li>
            <li>
                <h3>出院诊断</h3>
                <p>{{$value.cyzd}}</p>
            </li>
            <li>
                <h3>入院时主要体征</h3>
                <p>{{$value.ryszytz}}</p>
            </li>
            <li>
                <h3>实验室检查及主要会诊</h3>
                <p>{{$value.sysjc}}</p>
            </li>

        </ul>

    </li>

    {{/each}}
</script>



</html>